/**
 * ISWE.
 * Created on : 16/07/2009
 *
 * Copyright (c) 2009 ISWE.
 * Rafael Noronha de Almeida
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of Rafael Noronha de Almeida
 * ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Rafael.
 */
package br.com.iswe.recipemaster.entities.supplier;

import java.util.Date;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

import br.com.iswe.core.entidades.annotation.GeradorConfig;
import br.com.iswe.core.entidades.annotation.SecurityStrategyType;
import br.com.iswe.recipemaster.entities.BaseEntity;
import br.com.iswe.recipemaster.entities.DateRangeValid;

import com.google.appengine.api.datastore.Key;

/**
 *
 * Description: 
 *
 * @author Rafael Noronha de Almeida
 *
 * @version $Revision: 1.1 $ $Date: 2009/07/20 12:04:33 $
 *
 */
@Entity
@GeradorConfig(securityStrategy = SecurityStrategyType.ACEGI_ISWE_INTEGRATION)
public class PriceList extends BaseEntity implements DateRangeValid {

	private Key 	priceListId;
	private String 	name;
	
	//master
	private Supplier supplier;
	
	//details
	private List<PriceItem> priceItemList;
	
	private Date	validFrom;
	private Date	validTo;

	/**
	 * @return the priceListId
	 */
	@Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
	public Key getPriceListId() {
		return priceListId;
	}
	public void setPriceListId(Key priceListId) {
		this.priceListId = priceListId;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	/**
	 * @return the supplier
	 */
	@ManyToOne
	public Supplier getSupplier() {
		return supplier;
	}
	public void setSupplier(Supplier supplier) {
		this.supplier = supplier;
	}
	
	/**
	 * @return the priceItemList
	 */
	@OneToMany(mappedBy="priceList", targetEntity=PriceItem.class)
	public List<PriceItem> getPriceItemList() {
		return priceItemList;
	}
	public void setPriceItemList(List<PriceItem> priceItemList) {
		this.priceItemList = priceItemList;
	}

	/**
	 * @return the validFrom
	 */
	public Date getValidFrom() {
		return validFrom;
	}
	public void setValidFrom(Date validFrom) {
		this.validFrom = validFrom;
	}
	
	/**
	 * @return the validTo
	 */
	public Date getValidTo() {
		return validTo;
	}
	public void setValidTo(Date validTo) {
		this.validTo = validTo;
	}
}
